﻿@using KPIS.GERP.Models.ViewModel
@using KPIS.GERP.Models.ICM
@model KPIS.GERP.Models.ICM.ViewModel.GatheringPR

@if (Model.PrePurchaseRequestItem != null)
{     
    <div class="row-fluid">
    <table id="table" class="table table-striped table-bordered table-hover" aria-describedby="table_info">
            <thead>
                <tr>
                    
                    <th>
                        @Html.DisplayName("เลขที่ขอซื้อขอจ้าง")
                    </th>
                    <th>
                        @Html.DisplayName("รายการค่าใช้จ่าย")
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => Model.PrePurchaseRequestItem.FirstOrDefault().Qty)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => Model.PrePurchaseRequestItem.FirstOrDefault().Price)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => Model.PrePurchaseRequestItem.FirstOrDefault().Amount)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => Model.PrePurchaseRequestItem.FirstOrDefault().CreatedWhen)
                    </th>
					
                </tr>
            </thead>

            <tbody>
                @foreach (var m in Model.PrePurchaseRequestItem??new List<PrePurchaseRequestItem>())
                {
                    <tr>                       
						<td>
                            @*@Html.DisplayFor(model => m.PrePurchaseRequest.Code) *@
							@Html.ActionLink(@m.PrePurchaseRequest.Code, "Details", new { Id=m.PprItemId })
						</td>
						<td>
							@Html.DisplayFor(model => m.MasBudgetExpense.Name)
						</td>
						<td>
							@Html.DisplayFor(model => m.Qty)
						</td>
						<td>
							@Html.DisplayFor(model => m.Price)
						</td>
						<td>
							@Html.DisplayFor(model => m.Amount)
						</td>
						<td>
							@Html.DisplayFor(model => m.CreatedWhen)
						</td>                       
                    </tr>
                }
            </tbody>
        </table>
    </div>
}
